How to load an Icon on a CButton at Runtime?
2981
28-Mar-2011
Updated on 18-Sep-2020
Dependra Pathak
28-Mar-2011btnsample->ModifyStyle(0,BS_ICON,SWP_FRAMECHANGED); //change the style of CButton
HICON hIcon = ::LoadIcon(AfxGetInstanceHandle(),MAKEINTRESOURCE(IDI_ICON)); //load an Icon assuming IDI_ICON is ID of ICON
btnsample->SetIcon(hIcon);